import Vue from 'vue'
import VueRouter from 'vue-router'
import index from '../views/body/index.vue' //布局
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'index',
    component: index,
    redirect: '/home',
    children: [
      require('./home.js'), //首页
      require('./table.js'), //联赛列表
      require('./team.js'), //比赛列表
      require('./banner.js'), //赛事推荐列表
      require('./basketballer.js'), //球员列表
      require('./giftBag.js'), //礼包管理--新赛事报名用到
      require('./registeReview.js') //礼包管理--新赛事报名用到
    ]
    // children: []
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/conmon/login.vue')
  }
]

const router = new VueRouter({
  scrollBehavior() {
    document.querySelector('.Main') && (document.querySelector('.Main').scrollTop = 0)
  },
  routes
})

export default router
